package com.ruoyi.manager.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.manager.service.ITeachAnalysisService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * @author 李红
 * @version 1.0
 * @Description TODO
 * @createTime 2021年09月05日 11:28:00
 */
@Controller
@RequestMapping("/manager/analysis")
public class TeacheAnalysisController extends BaseController {

    @Autowired
    private ITeachAnalysisService teachAnalysisService;
    private String prefix = "/analysis";
    @RequiresPermissions("manager:analysis:view")
    @GetMapping()
    public String analysis()
    {
        return "redirect:"+prefix+"/teachAnalysis.html";
    }
    //在训班级情况信息一栏
    @ResponseBody
    @GetMapping("/classInfo")
    public List<Map<String,Object>> listClassesInfo(){
        List<Map<String, Object>> list = teachAnalysisService.listClassesInfo();
        return list;
    }
    @ResponseBody    //完成率、完成率低于40%、完成率低于80%、提交率
    @RequestMapping("/exInfo")
    public Map<String,Object> exInfo(){
        return teachAnalysisService.exInfo();
    }

    @ResponseBody    //统计当周统计在训的每个班级平均核心作业完成率和提交率
    @RequestMapping("/listCompleteRateSubmitRate")
    public List<Map<String,Object>> listCompleteRateSubmitRate(){
        return teachAnalysisService.listCompleteRateSubmitRate();
    }
    @ResponseBody    //统计当周统计在训的每个班级平均成绩
    @RequestMapping("/listClassesavg")
    public List<Map<String,Object>> listClassesavg(){
        return teachAnalysisService.listClassesavg();
    }

    @ResponseBody    //统计当周学员成绩分类
    @RequestMapping("/listStudentLevelCount")
    public  Map<String,Object> listStudentLevelCount(){
        return teachAnalysisService.listStudentLevelCount();
    }

    @ResponseBody  //完成率低于40%的展示图
    @RequestMapping("/listStudentCompleteRatelow40")
    public List<Map<String,Object>> listStudentCompleteRatelow40(){
        return teachAnalysisService.listStudentCompleteRatelow40();
    }
    @ResponseBody//本周总成绩、平均成绩
    @RequestMapping("/findClassessumandavg")
    public Map<String,Object> findClassessumandavg(){
        return teachAnalysisService.findClassessumandavg();
    }

    @ResponseBody//本周总成绩、平均成绩
    @RequestMapping("/listAssessSum")
    public List<Map<String,Object>> listAssessSum(){
        return teachAnalysisService.listAssessSum();
    }
    @ResponseBody//本周总成绩、平均成绩
    @RequestMapping("/listMasterCount")
    public List<Map<String,Object>>  listMasterCount(){
        return teachAnalysisService.listMasterCount();
    }

    @ResponseBody//本周总成绩、平均成绩
    @RequestMapping("/listStudentsEmployCityAndSalary")
    public List<Map<String,Object>>  listStudentsEmployCityAndSalary(){
        return teachAnalysisService.listStudentsEmployCityAndSalary();
    }
    @ResponseBody//定位信息
    @RequestMapping("/listStudentsLocation")
    public List<Map<String,Object>>  listStudentsLocation(){
        return teachAnalysisService.listStudentsLocation();
    }


}
